home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: MegaDisc / MegaDisc 30 (1992-10)(MegaDisc Digital Publishing)(AU)(Disk 1 of 2)[WB].zip / MegaDisc 30 (1992-10)(MegaDisc Digital Publishing)(AU)(Disk 1 of 2)[WB].adf / Tutes_&_CLI / Data_Recovery < prev    next >
Text File  |  1992-10-05  |  10KB  |  172 lines

  1.  
  2.  
  3.                          D A T A   R E C O V E R Y   
  4.                          -------------------------
  5.  
  6.                              by Paul McLachlan
  7.  
  8.  
  9.    Ed: For those who have wondered what a read/write error is, or how to get
  10.   a deleted file back, this is just the ticket.
  11.  
  12.  
  13.    ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ###
  14.  
  15.  
  16.                                 THE BASICS
  17.  
  18.    The process of data recovery has been around since people started making
  19.   mistakes with computers, and the data that they hold.  That is, data
  20.   recovery has been with us from the start.  People, being people, have a
  21.   nasty tendency to make mistakes, to have accidents.  This has led to the
  22.   race for one of two things: Perfection, where the person would not make
  23.   mistakes, as well as the ability to undo that which was done - in this
  24.   case, recovering the data.  Perfection, I am afraid, I cannot help you
  25.   achieve.  People have striven for perfection all their lives and not made
  26.   it.  While you are busy striving, might I suggest this alternative method?
  27.   Besides, once you achieve perfection you might not make any mistakes, but
  28.   you still have mistakes that you made previously.  Data Recovery is the key
  29.   to "undo"ing some of those mistakes that you might have made (but would
  30.   never own up to).
  31.  
  32.    Knowledge is power
  33.  
  34.    One of the major problems with data recovery is a lack of knowledge.  Not
  35.   knowledge on how to do it, you can always ask somebody that, but the lack
  36.   of knowledge that it is possible.  You see, when you delete a file from a
  37.   disk, it is very easy to give up and retype the entire document.  You do
  38.   this immediately, and without much thought, in an attempt to save as much
  39.   time as possible, as it may have taken hours to type out that whole
  40.   document.  What does not immediately present itself is the fact that it is
  41.   usually quite possible to get back a recently deleted file - and it doesn't
  42.   help that the Commodore manuals say next to nothing about it.  When you
  43.   have a major 'accident' take some time to consider what you have done, and,
  44.   more importantly, whether or not you can 'undo' it, to save yourself the
  45.   work that you have just lost.
  46.  
  47.    Two types of recovery
  48.  
  49.    There are really two general types of data recovery.  There is deleted
  50.   file recovery and scrambled data recovery.  Under deleted file we have the
  51.   'delete #? all' command.  Try it and see what it does (heh, heh).  Under
  52.   scrambled data recovery we have things such as computers who have been
  53.   turned off while a task was writing to the drive; we have general disk
  54.   (hard error) failures; we have dust collecting on the disk drive, and a
  55.   whole host of things that could befall your data.  Oh yeah, about that
  56.   'delete #? all' command, I was joking when I said try it.  If you really
  57.   did try it, then you may have a real motive to read the rest of this
  58.   article. Morale of the story: Before you try anything, read the rest of
  59.   the paragraph.
  60.  
  61.    Let me deal first with deleted file data recovery. This involves, as I
  62.   have previously stated, files that you have deleted from the disk.  This is
  63.   possible due to the way in which AmigaDOS deletes files from the disk.
  64.  
  65.    Here's a brief summary:
  66.  
  67.    When AmigaDOS wants to write data to a disk with a file name, it first
  68.   goes to the directory of the disk, and makes a new entry.  It writes the
  69.   name of the file, the date, protection bits, filenotes and other info
  70.   about the file into this directory, which is on the root block of the disk
  71.   (Lower side of cylinder 40).  It then searches through this directory
  72.   block, and works out where on the disk is free (unallocated for data) disk
  73.   space.  It then writes the location of this disk space into the directory
  74.   head, and begins writing the data at this location of previously free disk
  75.   space.  The disk could be fragmented, and it may have to use various
  76.   blocks, but that is another story, and shall be told another time (to keep
  77.   this from being a circular segment of the article).  Once it finishes, then
  78.   the access to the drive is finished.  When you then want to load that data
  79.   off the disk, then it reads the directory block, so that it can find the
  80.   first part of the data, and it then just reads it off the disk, starting at
  81.   that location.
  82.  
  83.    When you decide that you no longer want a file (or, to be accurate, tell
  84.   AmigaDOS you no longer want a file - whether you actually want it or not)
  85.   then AmigaDOS will remove the file from the disk by taking that files entry
  86.   out of the directory block, and setting the space it took up as free.
  87.   That's it.  No communal sacrifices at dawn, and no resetting every single
  88.   part of that file to nothing.  This means that deleting a file is often
  89.   quicker than reading and writing it.  It also means the file is still on
  90.   the disk.  Unfortunately, it won't stay there forever.  Next time you write
  91.   a file to the disk, and AmigaDOS finds some free disk space, it may well be
  92.   the space that was taken up by your deleted file, since this space is now
  93.   'free'.  Of course, on an empty disk, there is more chance it will find
  94.   some other space then on a disk which is 97% full, and that was the only
  95.   free space on the disk at all.  And so, your data is still there after a
  96.   delete, for the time being.
  97.  
  98.    Recovering this data is quite simple with a program that does it -
  99.   diskdoctor, fixdisk, disksalv, lasthope, just to name a few.  The program
  100.   does it by simply scanning every location on the disk, looking for files.
  101.   It then creates a list of every file which it thinks should be on the disk,
  102.   and cross-references this with what is listed in the directory.  What it
  103.   doesn't find has been deleted.  When it undeletes, it must simply check
  104.   that the file is all there, and then write an entry into the directory
  105.   listing for that file, giving its location on the disk, and setting its
  106.   space to 'used' (as opposed to free).
  107.  
  108.    Scrambled data recovery is a different story altogether.  The entry in the
  109.   directory listing is probably still there, but some of the data in the
  110.   actual file has changed.  This could do many things, such as scrambled text
  111.   in a dåæð#¶øµ¤ or a sound file having static in it.  It might cause a
  112.   program to GURU, or a picture to be distorted.  It could do any of these
  113.   things, but you've never seen it, have you.  Why?  Because captain AmigaDOS
  114.   keeps something called a checksum on his data.  The way it works, is that
  115.   he runs the data through a (usually simple) algorithm, and stores the
  116.   result of that on disk, near the file.  Whenever he reads that file in, he
  117.   re-does the algorithm on the data he reads in, and if it doesn't match with
  118.   the checksum recorded on the disk, then he gives a read/write error, and
  119.   stops - never giving the error the chance to manifest itself in nasty ways.
  120.   This read/write error is often your first warning of some scrambled data,
  121.   and the last thing you should do is panic.  If you have never seen a
  122.   scrambled data error, and want one to try and fix, I'll give you a
  123.   foolproof way of getting one (my evil ways coming out again, I'm afraid).
  124.  
  125.    Here goes: Get a very large file, and copy it to another disk, while the
  126.   drive light is on, hit control-amiga-amiga. Wow! What fun.  You could
  127.   have taken the disk out of the drive, but then you get a second chance.
  128.   You have just totally wrecked that file on the disk, only having saved half
  129.   of something, and probably not getting the correct checksum on it.  Boot up
  130.   again and put the disk in the drive.  See all the requesters flying at you
  131.   from nowhere?  Well, now you've seen what happens.  Oh, don't try that too
  132.   often, it's possible (in fact likely) that it does damage the disk or the
  133.   drive in some way, causing extra wear and tear.
  134.  
  135.    It's possible after all this that your data is still somewhere on that
  136.   disk, and the tiny glitch in data that caused the checksum to sound the
  137.   alarm quite small.  The various programs do this type of recovery in
  138.   various ways, but a common method is to just read the block in, set the
  139.   checksums to the correct values, and let the user try the thing, to see how
  140.   well it worked.  This, believe it or not, often works.
  141.  
  142.    So know you have a general idea of how data recovery on magnetic medium
  143.   works, and hopefully this will help you.  The most important thing to do
  144.   when something like this happens - is not to work on the original disk
  145.   unless you are sure you know what you're doing, and remember that it is
  146.   possible to get something back, so don't just reformat the disk and start
  147.   over.
  148.  
  149.    Kind offer
  150.  
  151.    If you have any data recovery problems on any of your disks, then you
  152.   might want to send it to me - I'll have a look at it for you, and see if I
  153.   can fix it.  But please, if you want me to do any of this, include a SASE
  154.   (Self Addressed, Stamped Envelope) for me to get the disk back to you.  I'm
  155.   not saying that I'm an expert, but I've recovered a lot of disks in my
  156.   time, from commercial games to simple data disks, and I know what I'm
  157.   doing.  Send me the original disk as well as another blank disk.  At worst,
  158.   you'll get the original disk and blank disk back blank.  At best, you'll
  159.   get the original and blank disk back - with everything nice and recovered
  160.   on the original disk.  You can then send me a note of extreme appreciation,
  161.   and perhaps a small donation?  Anyway, here is my address:
  162.  
  163.                       Paul Mclachlan
  164.                     60 Hatfield street
  165.                     Blakehurst, Sydney
  166.                         NSW, 2221
  167.  
  168.  
  169.    ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ### 30 ###
  170.  
  171.  
  172.